READ ME FILE

*******************************************************************************************
*******************************************************************************************
*Replication file for:
*The Importance of a Liberal Power's Attention to Democratic Elections Around the World
*Johannes Bubeck, Ashrakat Elshehawy, Nikolay Marinov, and Federico Nanni
*******************************************************************************************
*******************************************************************************************

Notes:

Programming Languages used: R, STATA, Python

Mainly the data in the main paper is based on data sources that are available online, please refer to their codebooks.

All required data sources are in the data folder in this zip file. Please run the code sequentially as described below. Please also make sure to change your working directory to where the data is placed on your machine.


Replicate the main paper:


- Run first 1_Dataprep.do to prepare general data that will be used frequently 

- Figure 1:  just an illustration of the setup of the game, thus doesn’t require replication code

- Figure 2 and 3: run the following do file: 2_Figure2and3_appendix_d6d7.do

- Figure 4:  run the following do file first: 3_figure4.do  this do file is used 1) to prepare the data for figure 4 a - the plot is created using R in the next step 2) and run the code to replicate regressions for figure 4b. Then to produce the plot itself for figure 4 a, run the following R code:  3_Figure4.R 

- Table 1 2 3: Run 4_Tables.do for all results in table 1, 2, and 3


Appendix:


- Table 4: Run this do file: 5_Table4_appendix.do - please note this is computationally intensive and takes a long time to run

- Table 5: Run the following Python notebook: 6_Table5_appendix.ipynb

- Figures C (C1, C2, C3, C4, and C5): Run the following do file: 7_FiguresC_appendix.do

- Figures D (D.6 and D.7): the following do file produces the results: 2_Figure2and3_appendix_d6d7.do. Its annotated in the code which part of the STATA code produces these plots.

- Table 6: Run the following do file: 8_Table6_appendix.do

- Figure D.8: run the following do file to prepare the data for the figure 9_FigureD.8_appendix.do, after that run this R code to plot the figure 9_FigureD.8_appendix.R

- Figure D.9: run the following 10_FigureD.9._appendix.do, followed by 10_FigureD.9._appendixR.R
